/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");

    //assets
    var template = require("./assets/tpl/roomsconfig_main.tpl");
    require("./assets/css/roomsconfig_main.css");

    //business

    //component
    var roomsConfigSubnavComp = require("./component/roomsConfigSubnav");
    var roomBaseGrid = require("./component/roomBaseGrid");
    var roomBaseForm = require("./component/roomBaseForm");
    var roomTypeGrid = require("./component/roomTypeGrid");
    var roomsConfigGridComp = require("./component/roomsConfigGrid");
    var roomsConfigDetailGridComp = require("./component/roomsConfigDetailGrid");

    //constant

    //handler

    //store

    var App = ELView.extend({
        attrs: {
            template: template
        },
        events:{
        	"click #selectAll":function(e){
        		console.log(e.target.checked);
        		if(e.target.checked){
        			$(".J-detailgrid input[type='checkbox']").prop("checked","true");
        		}else{
        			$(".J-detailgrid input[type='checkbox']").prop("checked","");
        		}
        	}
        },
        initComponent: function (params, widget) {
        	roomsConfigSubnavComp.initComponent(params,widget);
        	roomBaseGrid.initComponent(params,widget);
        	roomBaseForm.initComponent(params,widget);
        	roomTypeGrid.initComponent(params,widget);
        	roomsConfigGridComp.initComponent(params,widget);
        	roomsConfigDetailGridComp.initComponent(params,widget);

        },
        afterInitComponent: function (params, widget) {
			widget.get("roomBaseGrid").refresh();
        }
    });

    module.exports = App;
});
